package xyz.zhno.prototype;

import java.util.Date;

/**
 * 测试
 * @author zh_o
 * @date 2020-11-15
 */
public class Client {

    public static void main(String[] args) throws CloneNotSupportedException {
        Date date = new Date();
        // 创建原型对象
        Video sourceVideo = new Video("标题", date);
        Video cloneVideo = (Video) sourceVideo.clone();
        System.out.println("source => " + sourceVideo);
        System.out.println("clone => " + cloneVideo);

        cloneVideo.getCreateTime().setTime(124215215);

        System.out.println("sourceHash => " + sourceVideo);

        System.out.println();
        System.out.println("===============================");
        System.out.println();

        System.out.println("source => " + sourceVideo);
        System.out.println("clone => " + cloneVideo);

        // 克隆
        //Video cloneVideo = (Video) sourceVideo.clone();
        System.out.println("clone => " + cloneVideo);
        System.out.println("cloneHash => " + cloneVideo);
    }

}
